package temp

//
//type Listing struct {
//	HttpClient
//}
//
//func (l *Listing) ExtractParentAsin(resp *mamba.Response) string {
//	matcher := regexp.MustCompile(`"parentAsin"\s?:\s?"([^"]+)"`)
//	parentAsin := matcher.FindStringSubmatch(resp.String())
//	if len(parentAsin) > 0 {
//		return parentAsin[1]
//	}
//
//	return ""
//}
//
//func (l *Listing) ExtractVariations(resp *mamba.Response) map[string]string {
//	matcher := regexp.MustCompile(`"dimensionToAsinMap"\s?:\s?({[^}]+})`)
//
//	body := resp.String()
//
//	value := matcher.FindStringSubmatch(body)
//	var dimensionToAsinMap map[string]string
//	if len(value) > 0 {
//		json.Unmarshal([]byte(value[1]), &dimensionToAsinMap)
//	}
//
//	return dimensionToAsinMap
//
//	//matcher, _ = regexp.Compile(`variationValues"\s?:\s?({.+})`)
//	//variationValues := matcher.FindString(resp.String())
//	//
//	//matcher, _ = regexp.Compile(`asinVariationValues"\s?:\s?({.+})`)
//	//asinVariationValues := matcher.FindString(resp.String())
//	//
//	//matcher, _ = regexp.Compile(`dimensionValuesData"\s?:\s?({.+})`)
//	//dimensionValuesData := matcher.FindString(resp.String())
//	//
//	//matcher, _ = regexp.Compile(`asinToDimensionIndexMap"\s?:\s?({.+})`)
//	//asinToDimensionIndexMap := matcher.FindString(resp.String())
//
//}
//
//func (l *Listing) ExtractFormData(document *goquery.Document) (string, map[string]string) {
//	var formData = make(map[string]string)
//
//	action, _ := document.Find("#addToCart").Attr("action")
//	document.Find("#addToCart input").Each(func(i int, selection *goquery.Selection) {
//		name, _ := selection.Attr("name")
//		if name != "" {
//			value, _ := selection.Attr("value")
//			formData[name] = value
//		}
//	})
//
//	return action, formData
//}
//
//func (l *Listing) AddCart(url string, header, data map[string]string) (resp *mamba.Response, document *goquery.Document, err error) {
//	return l.request(POST, url, header, data, nil)
//}
